<?php

namespace App\Levels\Points;

abstract class BasePoint implements PointInterface
{
    protected $percent;

    protected string $label;

    public function __construct()
    {
        $this->setPercent(0);
    }

    public function setPercent(float $percent)
    {
        $this->percent = $percent;
    }

    public function getPercent(): float
    {
        return $this->percent;
    }

    protected function toIntPoint($value) : int
    {
        return round($value * $this->percent / 100);
    }

    public function getFromEvaluation(int $evaluation): int
    {
        return 0;
    }

    public function getLabel(): string
    {
        return $this->label;
    }
}
